package com.yunyan.config;

import com.yunyan.resp.JsonResp;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BusinessExceptionHandler {

    @ExceptionHandler(BusinessException.class)
    public JsonResp handle(BusinessException exception){
        return JsonResp.error(401, exception.getMessage());
    }
}
